using System;

namespace CinemaDirector
{
	[Serializable]
	public class GGVariableType<T> : GGVariable where T : new()
	{
		public T storedValue = new T();

		public virtual T value
		{
			get
			{
				return GetValue(localStore);
			}
			set
			{
				storedValue = value;
			}
		}

		public T GetValue(GGVariableStore store)
		{
			if (store != null)
			{
				GGVariableType<T> variable = GetVariable<GGVariableType<T>>(store);
				return variable.storedValue;
			}
			return storedValue;
		}
	}
}
